home *** CD-ROM | disk | FTP | other *** search
Text File | 2004-12-15 | 37.6 KB | 1,323 lines |
- function ultimateScrollerClass()
- {
- this.initialize();
- }
- ultimateScrollerClass.prototype = new MovieClip();
- ultimateScrollerClass.prototype.scrollUp = function()
- {
- if(this.enabled == false)
- {
- return undefined;
- }
- if(this.c_horizontal)
- {
- if(this.targetClip._x < this.scrollBottom)
- {
- var _loc4_ = this.targetClip._x + this.scrollAmount >= this.scrollBottom ? this.scrollBottom : this.targetClip._x + this.scrollAmount;
- var _loc2_ = (_loc4_ - this.scrollBottom) * 100 / (this.scrollBottom - this.scrollTop) * -1;
- this.drag._y = Math.floor(this.dragTop - (this.dragTop - this.dragBottom) / 100 * _loc2_);
- this.syncTargetPos();
- false;
- false;
- }
- }
- else if(this.targetClip._y < this.scrollTop)
- {
- var _loc3_ = this.targetClip._y + this.scrollAmount >= this.scrollTop ? this.scrollTop : this.targetClip._y + this.scrollAmount;
- _loc2_ = (_loc3_ - this.scrollTop) * 100 / (this.scrollTop - this.scrollBottom) * -1;
- this.drag._y = Math.floor(this.dragTop - (this.dragTop - this.dragBottom) / 100 * _loc2_);
- this.syncTargetPos();
- false;
- false;
- }
- };
- ultimateScrollerClass.prototype.scrollDown = function()
- {
- if(this.enabled == false)
- {
- return undefined;
- }
- if(this.c_horizontal == true)
- {
- if(this.targetClip._x > this.scrollTop)
- {
- var _loc4_ = this.targetClip._x - this.scrollAmount <= this.scrollTop ? this.scrollTop : this.targetClip._x - this.scrollAmount;
- var _loc2_ = (_loc4_ - this.scrollBottom) * 100 / (this.scrollBottom - this.scrollTop) * -1;
- this.drag._y = Math.ceil(this.dragTop - (this.dragTop - this.dragBottom) / 100 * _loc2_);
- this.syncTargetPos();
- false;
- false;
- }
- }
- else if(this.targetClip._y > this.scrollBottom)
- {
- var _loc3_ = this.targetClip._y - this.scrollAmount <= this.scrollBottom ? this.scrollBottom : this.targetClip._y - this.scrollAmount;
- _loc2_ = (_loc3_ - this.scrollTop) * 100 / (this.scrollTop - this.scrollBottom) * -1;
- this.drag._y = Math.ceil(this.dragTop - (this.dragTop - this.dragBottom) / 100 * _loc2_);
- this.syncTargetPos();
- false;
- false;
- }
- };
- ultimateScrollerClass.prototype.pageUp = function()
- {
- var _loc2_ = this.c_scrollAmount;
- this.c_scrollAmount = int(this.h);
- this.scrollUp();
- this.c_scrollAmount = _loc2_;
- false;
- };
- ultimateScrollerClass.prototype.pageDown = function()
- {
- var _loc2_ = this.c_scrollAmount;
- this.c_scrollAmount = int(this.h);
- this.scrollDown();
- this.c_scrollAmount = _loc2_;
- false;
- };
- ultimateScrollerClass.prototype.scrollToTop = function()
- {
- if(this.enabled == false)
- {
- return undefined;
- }
- this.drag._y = this.dragTop;
- this.syncTargetPos();
- };
- ultimateScrollerClass.prototype.scrollToBottom = function()
- {
- if(this.enabled == false)
- {
- return undefined;
- }
- this.drag._y = this.dragBottom;
- this.syncTargetPos();
- };
- ultimateScrollerClass.prototype.getScrollPosition = function()
- {
- return this.drag._y;
- };
- ultimateScrollerClass.prototype.setScrollPosition = function(scrollPos)
- {
- this.drag._y = scrollPos;
- };
- ultimateScrollerClass.prototype.setDragHeight = function(usrHeight)
- {
- this.c_dragHeight = usrHeight;
- if(usrHeight > this.track_mc._height - 48)
- {
- usrHeight = this.track_mc._height - 48;
- }
- else if(usrHeight < 2)
- {
- usrHeight = 2;
- }
- this.dragHeight = usrHeight;
- var btnDrag = this.attachMovie("ultimateScroller_drag","drag",5,{_x:0,_y:16,w:this.c_scrollWidth,h:this.dragHeight});
- btnDrag.useHandCursor = false;
- this.dragTop = 16;
- this.dragBottom = this.h - 16 - this.dragHeight;
- if(this.scrollTo != null)
- {
- btnDrag._y = this.scrollTo <= this.dragBottom ? this.scrollTo : this.dragBottom;
- var _loc4_ = this.c_easing;
- this.c_easing = "none";
- this.syncTargetPos();
- this.c_easing = _loc4_;
- false;
- }
- btnDrag.onMouseDown = function()
- {
- if(this._parent.enabled == false)
- {
- return undefined;
- }
- if(btnDrag.hitTest(_root._xmouse,_root._ymouse))
- {
- btnDrag.startDrag(false,0,this._parent.dragTop,0,this._parent.dragBottom);
- this._parent.dragging = true;
- updateAfterEvent();
- }
- };
- btnDrag.onMouseUp = function()
- {
- btnDrag.stopDrag();
- this._parent.dragging = false;
- updateAfterEvent();
- };
- if(!this.c_dragVisible)
- {
- this.drag._visible = false;
- }
- };
- ultimateScrollerClass.prototype.initialize = function()
- {
- this.setDefaults();
- this.enabled = false;
- if(this.c_horizontal == true)
- {
- this._rotation = -90;
- this._xscale = -100;
- this._y = int(this._y + 16);
- if(this.size == null)
- {
- this.setSize(this._width);
- }
- else
- {
- this.setSize(this.size);
- }
- }
- else
- {
- this._rotation = 0;
- this._xscale = 100;
- if(this.size == null)
- {
- this.setSize(this._height);
- }
- else
- {
- this.setSize(this.size);
- }
- }
- if(this._targetInstanceName.length > 0)
- {
- var _loc2_ = this._parent[this._targetInstanceName];
- this.initX = _loc2_._x;
- this.initY = _loc2_._y;
- this.initW = _loc2_._width;
- this.initH = _loc2_._height;
- this.setTarget(_loc2_);
- false;
- }
- else
- {
- this.setEnabled(false);
- }
- };
- ultimateScrollerClass.prototype.setDefaults = function()
- {
- if(this.c_horizontal == null)
- {
- if(this.horizontal == null)
- {
- this.c_horizontal = false;
- }
- else
- {
- this.c_horizontal = Boolean(this.horizontal);
- delete this.horizontal;
- }
- }
- if(this.c_buffer == null)
- {
- if(this.buffer == null)
- {
- this.c_buffer = 10;
- }
- else
- {
- this.c_buffer = int(this.buffer);
- delete this.buffer;
- }
- }
- if(this.c_scrollAmount == null)
- {
- if(this.scrollAmount == null)
- {
- this.c_scrollAmount = 40;
- }
- else
- {
- this.c_scrollAmount = int(this.scrollAmount);
- delete this.scrollAmount;
- }
- }
- if(this.c_easing == null)
- {
- if(this.easing == null)
- {
- this.c_easing = "none";
- }
- else
- {
- this.c_easing = this.easing;
- delete this.easing;
- }
- }
- if(this.c_useMask == null)
- {
- if(this.useMask == null)
- {
- this.c_useMask = false;
- }
- else
- {
- this.c_useMask = Boolean(this.useMask);
- delete this.useMask;
- }
- }
- if(this.c_dragVisible == null)
- {
- if(this.dragVisible == null)
- {
- this.c_dragVisible = true;
- }
- else
- {
- this.c_dragVisible = Boolean(this.dragVisible);
- delete this.dragVisible;
- }
- }
- if(this.c_dragAuto == null)
- {
- if(this.dragHeightAuto == null)
- {
- this.c_dragAuto = true;
- }
- else
- {
- this.c_dragAuto = Boolean(this.dragHeightAuto);
- delete this.dragHeightAuto;
- }
- }
- if(this.c_scrollTrackVisible == null)
- {
- if(this.scrollTrackVisible == null)
- {
- this.c_scrollTrackVisible = true;
- }
- else
- {
- this.c_scrollTrackVisible = Boolean(this.scrollTrackVisible);
- delete this.scrollTrackVisible;
- }
- }
- if(this.c_buttonsVisible == null)
- {
- if(this.buttonsVisible == null)
- {
- this.c_buttonsVisible = true;
- }
- else
- {
- this.c_buttonsVisible = Boolean(this.buttonsVisible);
- delete this.buttonsVisible;
- }
- }
- if(this.c_arrowsVisible == null)
- {
- if(this.arrowsVisible == null)
- {
- this.c_arrowsVisible = true;
- }
- else
- {
- this.c_arrowsVisible = Boolean(this.arrowsVisible);
- delete this.arrowsVisible;
- }
- }
- if(this.c_arrowDefaultColor == null)
- {
- if(this.arrowDefaultColor == null)
- {
- this.c_arrowDefaultColor = false;
- }
- else
- {
- this.c_arrowDefaultColor = Boolean(this.arrowDefaultColor);
- delete this.arrowDefaultColor;
- }
- }
- if(this.c_scrollWidth == null)
- {
- if(this.scrollWidth == null)
- {
- this.c_scrollWidth = 16;
- }
- else
- {
- this.c_scrollWidth = int(this.scrollWidth);
- delete this.scrollWidth;
- }
- }
- if(this.c_useDisabledColor == null)
- {
- if(this.useDisabledColor == null)
- {
- this.c_useDisabledColor = true;
- }
- else
- {
- this.c_useDisabledColor = Boolean(this.useDisabledColor);
- delete this.useDisabledColor;
- }
- }
- if(this.c_scrollSide == null)
- {
- if(this.scrollSide == null)
- {
- this.c_scrollSide = "right";
- }
- else
- {
- this.c_scrollSide = String(this.scrollSide);
- delete this.scrollSide;
- }
- }
- if(this.c_face == null)
- {
- if(this.face == null)
- {
- this.c_face = 14078926;
- }
- else
- {
- this.c_face = this.face;
- delete this.face;
- }
- }
- if(this.c_shadow == null)
- {
- if(this.shadow == null)
- {
- this.c_shadow = 8684164;
- }
- else
- {
- this.c_shadow = this.shadow;
- delete this.shadow;
- }
- }
- if(this.c_darkshadow == null)
- {
- if(this.darkshadow == null)
- {
- this.c_darkshadow = 4342082;
- }
- else
- {
- this.c_darkshadow = this.darkshadow;
- delete this.darkshadow;
- }
- }
- if(this.c_highlight == null)
- {
- if(this.highlight == null)
- {
- this.c_highlight = 16777215;
- }
- else
- {
- this.c_highlight = this.highlight;
- delete this.highlight;
- }
- }
- if(this.c_highlight3d == null)
- {
- if(this.highlight3d == null)
- {
- this.c_highlight3d = 14078926;
- }
- else
- {
- this.c_highlight3d = this.highlight3d;
- }
- }
- if(this.c_arrow == null)
- {
- if(this.arrow == null)
- {
- this.c_arrow = 0;
- }
- else
- {
- this.c_arrow = this.arrow;
- delete this.arrow;
- }
- }
- if(this.c_foregroundDisabled == null)
- {
- if(this.foregroundDisabled == null)
- {
- this.c_foregroundDisabled = 10066329;
- }
- else
- {
- this.c_foregroundDisabled = this.foregroundDisabled;
- delete this.foregroundDisabled;
- }
- }
- if(this.c_scrollTrack == null)
- {
- if(this.scrollTrack == null)
- {
- this.c_scrollTrack = 15066078;
- }
- else
- {
- this.c_scrollTrack = this.scrollTrack;
- delete this.scrollTrack;
- }
- }
- if(this.c_borderColorTop == null)
- {
- if(this.borderColorTop == null)
- {
- this.c_borderColorTop = 0;
- }
- else
- {
- this.c_borderColorTop = this.borderColorTop;
- delete this.borderColorTop;
- }
- }
- if(this.c_borderColorBottom == null)
- {
- if(this.borderColorBottom == null)
- {
- this.c_borderColorBottom = 0;
- }
- else
- {
- this.c_borderColorBottom = this.borderColorBottom;
- delete this.borderColorBottom;
- }
- }
- if(this.c_borderColorLeft == null)
- {
- if(this.borderColorLeft == null)
- {
- this.c_borderColorLeft = 0;
- }
- else
- {
- this.c_borderColorLeft = this.borderColorLeft;
- delete this.borderColorLeft;
- }
- }
- if(this.c_borderColorRight == null)
- {
- if(this.borderColorRight == null)
- {
- this.c_borderColorRight = 0;
- }
- else
- {
- this.c_borderColorRight = this.borderColorRight;
- delete this.borderColorRight;
- }
- }
- if(this.scrollTarget != null)
- {
- this.setTarget(this.scrollTarget);
- delete this.scrollTarget;
- }
- };
- ultimateScrollerClass.prototype.setEnabled = function(e)
- {
- this.enabled = e;
- if(this.enabled)
- {
- this.button_up.gotoAndStop("up");
- this.button_down.gotoAndStop("up");
- }
- else
- {
- this.button_up.gotoAndStop("disabled");
- this.button_down.gotoAndStop("disabled");
- this.drag.removeMovieClip();
- }
- this.button_up.setSkins();
- this.drag.setSkins();
- this.button_down.setSkins();
- };
- ultimateScrollerClass.prototype.clearDelay = function()
- {
- clearInterval(this.delayTimer);
- this.scrollDelay = false;
- };
- ultimateScrollerClass.prototype.resetPositions = function()
- {
- this.targetClip._x = this.initX;
- this.targetClip._y = this.initY;
- this.drag._y = this.dragTop;
- };
- ultimateScrollerClass.prototype.drawMask = function()
- {
- var mx = 0;
- var my = 0;
- var mwidth = 0;
- var mheight = 0;
- this.resetPositions();
- if(this.c_horizontal == true)
- {
- mwidth = this.track_mc._height - 0.5;
- mheight = this._y - this.targetClip._y;
- mx = this._x;
- my = this.targetClip._y;
- }
- else if(this.c_scrollSide eq "right")
- {
- mwidth = this._x - this.targetClip._x;
- mheight = this.h - 0.5;
- mx = this.targetClip._x - 1.5;
- my = this._y;
- }
- else
- {
- var bWidth = this.targetClip._x + this.targetClip._width - this._x - this._width + 16.5;
- mwidth = this.targetClip._x + this.targetClip._width - this._x - this._width + 3;
- mheight = this.h - 0.5;
- mx = this.targetClip._x - 0.5;
- my = this._y;
- }
- this.maskObj.removeMovieClip();
- this.maskObj = this._parent.createEmptyMovieClip(this.targetClip._name + "_mask",this.targetClip.getDepth() + 44496 + random(1774) + (random(4) + 1),{_x:this.targetClip._x,_y:this.targetClip._y});
- with(this.maskObj)
- {
- beginFill(16711680);
- lineStyle(0);
- moveTo(0,0);
- lineTo(mwidth,0);
- lineTo(mwidth,mheight);
- lineTo(0,mheight);
- lineTo(0,0);
- endFill();
- }
- this.maskObj._x = mx;
- this.maskObj._y = my;
- this.targetClip.setMask(this.maskObj);
- };
- ultimateScrollerClass.prototype.drawBorder = function()
- {
- this.resetPositions();
- if(this.c_horizontal == true)
- {
- var bWidth = this.h + 1;
- var bHeight = this._y - this.targetClip._y + 1.5 - (16 - this.c_scrollWidth);
- var bX = this._x - 0.5;
- var bY = this.targetClip._y - 1;
- }
- else if(this.c_scrollSide eq "right")
- {
- if(this.c_borderStyle == "3d")
- {
- var bWidth = this._x - this.targetClip._x + this.c_scrollWidth + 4;
- var bHeight = this.h + 1.5;
- var bX = this.targetClip._x - 3;
- var bY = this._y - 0.5;
- }
- else
- {
- var bWidth = this._x - this.targetClip._x + this.c_scrollWidth + 2;
- var bHeight = this.h + 1.5;
- var bX = this.targetClip._x - 1.5;
- var bY = this._y - 1;
- }
- }
- else if(this.c_borderStyle == "3d")
- {
- var bWidth = this.targetClip._x + this.targetClip._width - this._x + 4;
- var bHeight = this.h + 1.5;
- var bX = this._x - 2.5;
- var bY = this._y - 1;
- }
- else
- {
- var bWidth = this.targetClip._x + this.targetClip._width - this._x + 2;
- var bHeight = this.h + 1.5;
- var bX = this._x - 1;
- var bY = this._y - 1;
- }
- this.borderObj.removeMovieClip();
- this.borderObj = this._parent.createEmptyMovieClip(this.targetClip._name + "_border",this.targetClip.getDepth() + 55596 + random(622) + (random(9) + 2),{_x:this.targetClip._x,_y:this.targetClip._y});
- switch(String(this.c_borderStyle))
- {
- case "line":
- with(this.borderObj)
- {
- lineStyle(1,this.c_borderColorT);
- moveTo(0,0);
- lineTo(bWidth,0);
- lineStyle(1,this.c_borderColorR);
- lineTo(bWidth,bHeight);
- lineStyle(1,this.c_borderColorB);
- lineTo(0,bHeight);
- lineStyle(1,this.c_borderColorL);
- lineTo(0,0);
- }
- break;
- case "3d":
- bWidth += 1;
- bHeight += 3;
- bX += 1;
- bY -= 1;
- with(this.borderObj)
- {
- lineStyle(2,this.c_shadow);
- moveTo(0,0);
- lineTo(bWidth,0);
- lineStyle(0.75,this.c_highlight3d);
- lineTo(bWidth,bHeight);
- lineTo(0,bHeight);
- lineStyle(2,this.c_shadow);
- lineTo(0,0);
- }
- }
- this.borderObj._width = bWidth + 0.5;
- this.borderObj._height = bHeight + 0.5;
- this.borderObj._x = bX + 0.5;
- this.borderObj._y = bY + 0.5;
- delete bWidth;
- delete bHeight;
- delete bX;
- delete bY;
- };
- ultimateScrollerClass.prototype.syncTargetPos = function()
- {
- var _loc2_ = (this.drag._y - 16) * 100 / (this.dragBottom - this.dragTop);
- if(this.c_horizontal == true)
- {
- if(this.c_easing ne "none")
- {
- switch(this.c_easing)
- {
- case "high":
- var _loc3_ = 8;
- break;
- case "med":
- _loc3_ = 6;
- break;
- case "low":
- _loc3_ = 4;
- }
- this.easeTo(int(this.scrollBottom - (this.scrollBottom - this.scrollTop) / 100 * _loc2_),this.targetClip._y,_loc3_);
- }
- else
- {
- this.targetClip._x = int(this.scrollBottom - (this.scrollBottom - this.scrollTop) / 100 * _loc2_);
- }
- }
- else if(this.c_easing ne "none")
- {
- switch(this.c_easing)
- {
- case "high":
- _loc3_ = 8;
- break;
- case "med":
- _loc3_ = 6;
- break;
- case "low":
- _loc3_ = 4;
- }
- this.easeTo(this.targetClip._x,int(this.scrollTop - (this.scrollTop - this.scrollBottom) / 100 * _loc2_),_loc3_);
- }
- else
- {
- this.targetClip._y = int(this.scrollTop - (this.scrollTop - this.scrollBottom) / 100 * _loc2_);
- }
- false;
- false;
- };
- ultimateScrollerClass.prototype.onEnterFrame = function()
- {
- if(this.initW != this.targetClip._width || this.initH != this.targetClip._height)
- {
- this.setSize(this.h);
- }
- if(this.enabled == false)
- {
- return undefined;
- }
- this.syncTargetPos();
- if(this.scrollDelay == true)
- {
- return undefined;
- }
- if(this.scrolling eq "DOWN")
- {
- this.scrollDown();
- }
- if(this.scrolling eq "UP")
- {
- this.scrollUp();
- }
- if(this.scrolling eq "PAGEDOWN")
- {
- this.pageDown();
- }
- if(this.scrolling eq "PAGEUP")
- {
- this.pageUp();
- }
- };
- ultimateScrollerClass.prototype.onUnload = function()
- {
- this.maskObj.removeMovieClip();
- this.borderObj.removeMovieClip();
- };
- ultimateScrollerClass.prototype.easeTo = function(tx, ty, speed)
- {
- this.easeMov.removeMovieClip();
- if(this.targetClip._x == tx && this.targetClip._y == ty)
- {
- return undefined;
- }
- var _loc3_ = this.createEmptyMovieClip("easeMov",99945);
- var scroller = this;
- var oldY = scroller.targetClip._y;
- var oldX = scroller.targetClip._x;
- _loc3_.onEnterFrame = function()
- {
- if(scroller.c_horizontal == true)
- {
- var _loc3_ = scroller.targetClip._x - tx >= 0 ? scroller.targetClip._x - tx : (scroller.targetClip._x - tx) * -1;
- var _loc2_ = (tx - oldX) / speed;
- if(_loc2_ < 0 and _loc2_ > -1)
- {
- _loc2_ = -1;
- }
- if(_loc2_ > 0 and _loc2_ < 1)
- {
- _loc2_ = 1;
- }
- newX = oldX + _loc2_;
- oldX = newX;
- scroller.targetClip._x = int(newX);
- false;
- false;
- }
- else
- {
- _loc3_ = scroller.targetClip._y - ty >= 0 ? scroller.targetClip._y - ty : (scroller.targetClip._y - ty) * -1;
- _loc2_ = (ty - oldY) / speed;
- if(_loc2_ < 0 and _loc2_ > -1)
- {
- _loc2_ = -1;
- }
- if(_loc2_ > 0 and _loc2_ < 1)
- {
- _loc2_ = 1;
- }
- newY = oldY + _loc2_;
- oldY = newY;
- scroller.targetClip._y = int(newY);
- false;
- false;
- }
- updateAfterEvent();
- if(_loc3_ < 1)
- {
- scroller.targetClip._x = int(scroller.targetClip._x);
- scroller.targetClip._y = int(scroller.targetClip._y);
- this.removeMovieClip();
- }
- };
- false;
- delete scroller;
- };
- ultimateScrollerClass.prototype.getHorizontal = function()
- {
- return this.c_horizontal;
- };
- ultimateScrollerClass.prototype.setHorizontal = function(p)
- {
- this.c_horizontal = Boolean(p);
- if(this.h)
- {
- this._rotation = -90;
- this._xscale = -100;
- this.setSize(this._width);
- }
- else
- {
- this._rotation = 0;
- this._xscale = 100;
- this.setSize(this._height);
- }
- };
- ultimateScrollerClass.prototype.getTarget = function()
- {
- return this.targetClip;
- };
- ultimateScrollerClass.prototype.setTarget = function(t)
- {
- if(this.drag._y != undefined)
- {
- this.scrollTo = this.drag._y;
- }
- else
- {
- this.scrollTo = null;
- }
- this.resetPositions();
- if(eval(t))
- {
- this.targetClip = t;
- this.targetClip._x = int(this.targetClip._x);
- this.targetClip._y = int(this.targetClip._y);
- this.initX = int(this.targetClip._x);
- this.initY = int(this.targetClip._y);
- this.initH = this.targetClip._height;
- this.initW = this.targetClip._width;
- if(this.c_horizontal == true)
- {
- this.targetClip._x = this.initX;
- this._x = int(this._x);
- this._y = int(this._y);
- }
- else
- {
- this.targetClip._y = this.initY;
- this._x = int(this._x);
- this._y = int(this._y);
- }
- if(this.c_useMask)
- {
- this.drawMask();
- }
- if(this.c_borderStyle ne "none")
- {
- this.drawBorder();
- }
- if(this.c_horizontal == true)
- {
- this.scrollBottom = int(this.targetClip._x);
- this.scrollTop = int(this.targetClip._x) - Math.ceil(this.targetClip._width - (this._width - (this.c_buffer + 2)) - (this._x - this.targetClip._x));
- this.visiblePercent = this.h * 100 / (this.targetClip._width - (this._x - this.targetClip._x));
- if(this.scrollTop >= this.scrollBottom)
- {
- this.setEnabled(false);
- return undefined;
- }
- }
- else
- {
- this.scrollTop = int(this.targetClip._y);
- this.scrollBottom = Math.ceil((this.targetClip._height - (this.h - (this.c_buffer + 2))) * -1) + this.scrollTop + (this._y - this.targetClip._y);
- this.visiblePercent = this.h * 100 / (this.targetClip._height - (this._y - this.targetClip._y));
- if(this.scrollTop <= this.scrollBottom)
- {
- this.setEnabled(false);
- return undefined;
- }
- }
- this.setEnabled(true);
- this.drawDrag();
- if(!this.c_dragVisible)
- {
- this.drag._visible = false;
- }
- }
- else
- {
- delete this.targetClip;
- this.setEnabled(false);
- }
- delete btnDrag;
- };
- ultimateScrollerClass.prototype.drawDrag = function()
- {
- this.dragHeight = (this.h - 32) / 100 * this.visiblePercent;
- this.dragHeight = this.dragHeight <= int(this.h - 34) ? int(this.dragHeight) : int(this.h - 34);
- this.dragHeight = this.dragHeight >= 6 ? int(this.dragHeight) : 6;
- if(!this.c_dragAuto)
- {
- if(this.c_dragHeight > this.track_mc._height - 48)
- {
- this.c_dragHeight = this.track_mc._height - 48;
- }
- else if(this.c_dragHeight < 2)
- {
- this.c_dragHeight = 2;
- }
- this.dragHeight = this.c_dragHeight;
- }
- var btnDrag = this.attachMovie("ultimateScroller_drag","drag",5,{_x:0,_y:16,w:this.c_scrollWidth,h:this.dragHeight});
- btnDrag.useHandCursor = false;
- this.dragTop = 16;
- this.dragBottom = this.h - 16 - this.dragHeight;
- if(this.scrollTo != null)
- {
- btnDrag._y = this.scrollTo <= this.dragBottom ? this.scrollTo : this.dragBottom;
- var _loc3_ = this.c_easing;
- this.c_easing = "none";
- this.syncTargetPos();
- this.c_easing = _loc3_;
- false;
- }
- btnDrag.onMouseDown = function()
- {
- if(this._parent.enabled == false)
- {
- return undefined;
- }
- if(btnDrag.hitTest(_root._xmouse,_root._ymouse))
- {
- btnDrag.startDrag(false,0,this._parent.dragTop,0,this._parent.dragBottom);
- this._parent.dragging = true;
- updateAfterEvent();
- }
- };
- btnDrag.onMouseUp = function()
- {
- btnDrag.stopDrag();
- this._parent.dragging = false;
- updateAfterEvent();
- };
- };
- ultimateScrollerClass.prototype.getSize = function()
- {
- return this.h;
- };
- ultimateScrollerClass.prototype.setSize = function(s)
- {
- this.h = s > 55 ? int(s) : 55;
- this._xscale = this._yscale = 100;
- this.track_mc._height = this.h;
- if(this.c_horizontal == true)
- {
- this.attachMovie("ultimateScroller_button_left","button_up",1,{_x:0,_y:0});
- this.button_up.gotoAndStop(3);
- this.attachMovie("ultimateScroller_button_right","button_down",2,{_x:0,_y:this.h - 16});
- this.button_down.gotoAndStop(3);
- }
- else
- {
- this.attachMovie("ultimateScroller_button_up","button_up",1,{_x:0,_y:0});
- this.button_up.gotoAndStop(3);
- this.attachMovie("ultimateScroller_button_down","button_down",2,{_x:0,_y:this.h - 16});
- this.button_down.gotoAndStop(3);
- }
- if(this.targetClip)
- {
- this.setTarget(this.targetClip);
- }
- else
- {
- this.setEnabled(false);
- }
- };
- ultimateScrollerClass.prototype.getBuffer = function()
- {
- return this.c_buffer;
- };
- ultimateScrollerClass.prototype.setBuffer = function(p)
- {
- this.c_buffer = int(p);
- };
- ultimateScrollerClass.prototype.getEasing = function()
- {
- return this.c_easing;
- };
- ultimateScrollerClass.prototype.setEasing = function(p)
- {
- this.c_easing = String(p);
- };
- ultimateScrollerClass.prototype.getScrollAmount = function()
- {
- return this.c_scrollAmount;
- };
- ultimateScrollerClass.prototype.setScrollAmount = function(p)
- {
- this.c_scrollAmount = int(p);
- };
- ultimateScrollerClass.prototype.getUseMask = function()
- {
- return this.c_useMask;
- };
- ultimateScrollerClass.prototype.setUseMask = function(p)
- {
- this.c_useMask = Boolean(p);
- if(this.c_useMask && eval(this.targetClip._name))
- {
- this.drawMask();
- }
- else
- {
- var tmp = eval(this.targetClip._name + "_mask");
- tmp.removeMovieClip();
- delete tmp;
- }
- };
- ultimateScrollerClass.prototype.getScrollTrackVisible = function()
- {
- return this.c_scrollTrackVisible;
- };
- ultimateScrollerClass.prototype.setScrollTrackVisible = function(p)
- {
- this.c_scrollTrackVisible = Boolean(p);
- };
- ultimateScrollerClass.prototype.getButtonsVisible = function()
- {
- return this.c_buttonsVisible;
- };
- ultimateScrollerClass.prototype.setButtonsVisible = function(p)
- {
- this.c_buttonsVisible = Boolean(p);
- };
- ultimateScrollerClass.prototype.getArrowsVisible = function()
- {
- return this.c_arrowsVisible;
- };
- ultimateScrollerClass.prototype.setArrowsVisible = function(p)
- {
- this.c_arrowsVisible = Boolean(p);
- };
- ultimateScrollerClass.prototype.getArrowDefaultColor = function()
- {
- return this.c_arrowDefaultColor;
- };
- ultimateScrollerClass.prototype.setArrowDefaultColor = function(p)
- {
- this.c_arrowDefaultColor = Boolean(p);
- };
- ultimateScrollerClass.prototype.getUseDisabledColor = function()
- {
- return this.c_useDisabledColor;
- };
- ultimateScrollerClass.prototype.setUseDisabledColor = function(p)
- {
- this.c_useDisabledColor = Boolean(p);
- };
- ultimateScrollerClass.prototype.getScrollWidth = function()
- {
- return this.c_scrollWidth;
- };
- ultimateScrollerClass.prototype.setScrollWidth = function(p)
- {
- this.c_scrollWidth = int(p);
- this.drawDrag();
- this.drawBorder();
- };
- ultimateScrollerClass.prototype.getDragVisible = function()
- {
- return this.c_dragVisible;
- };
- ultimateScrollerClass.prototype.setDragVisible = function(p)
- {
- this.c_dragVisible = Boolean(p);
- if(this.c_dragVisible)
- {
- this.drag._visible = true;
- }
- else
- {
- this.drag._visible = false;
- }
- };
- ultimateScrollerClass.prototype.getDragHeightAuto = function()
- {
- return this.c_dragAuto;
- };
- ultimateScrollerClass.prototype.setDragHeightAuto = function(p)
- {
- this.c_dragAuto = Boolean(p);
- this.drawDrag();
- };
- ultimateScrollerClass.prototype.getScrollSide = function()
- {
- return this.c_scrollSide;
- };
- ultimateScrollerClass.prototype.setScrollSide = function(p)
- {
- this.c_scrollSide = String(p);
- this.drawMask();
- this.drawBorder();
- };
- ultimateScrollerClass.prototype.getBorderStyle = function()
- {
- return this.c_borderStyle;
- };
- ultimateScrollerClass.prototype.setBorderStyle = function(p)
- {
- this.c_borderStyle = p.toLowerCase();
- var tmp = eval(this.targetClip._name + "_border");
- tmp.removeMovieClip();
- if(this.c_borderStyle ne "none" && eval(this.targetClip._name))
- {
- this.drawBorder();
- }
- delete tmp;
- };
- ultimateScrollerClass.prototype.getFace = function()
- {
- return this.c_face;
- };
- ultimateScrollerClass.prototype.setFace = function(p)
- {
- this.c_face = p;
- this.button_up.setSkins();
- this.drag.setSkins();
- this.button_down.setSkins();
- this.track_mc.setSkins();
- };
- ultimateScrollerClass.prototype.getShadow = function()
- {
- return this.c_shadow;
- };
- ultimateScrollerClass.prototype.setShadow = function(p)
- {
- this.c_shadow = p;
- this.button_up.setSkins();
- this.drag.setSkins();
- this.button_down.setSkins();
- this.track_mc.setSkins();
- if(this.c_borderStyle ne "none" && eval(this.targetClip._name))
- {
- this.drawBorder();
- }
- };
- ultimateScrollerClass.prototype.getDarkshadow = function()
- {
- return this.c_darkshadow;
- };
- ultimateScrollerClass.prototype.setDarkshadow = function(p)
- {
- this.c_darkshadow = p;
- this.button_up.setSkins();
- this.drag.setSkins();
- this.button_down.setSkins();
- this.track_mc.setSkins();
- };
- ultimateScrollerClass.prototype.getHighlight = function()
- {
- return this.c_highlight;
- };
- ultimateScrollerClass.prototype.setHighlight = function(p)
- {
- this.c_highlight = p;
- this.button_up.setSkins();
- this.drag.setSkins();
- this.button_down.setSkins();
- this.track_mc.setSkins();
- };
- ultimateScrollerClass.prototype.getHighlight3d = function()
- {
- return this.c_highlight3d;
- };
- ultimateScrollerClass.prototype.setHighlight3d = function(p)
- {
- this.c_highlight3d = p;
- this.button_up.setSkins();
- this.drag.setSkins();
- this.button_down.setSkins();
- this.track_mc.setSkins();
- if(this.c_borderStyle ne "none" && eval(this.targetClip._name))
- {
- this.drawBorder();
- }
- };
- ultimateScrollerClass.prototype.getArrow = function()
- {
- return this.c_arrow;
- };
- ultimateScrollerClass.prototype.setArrow = function(p)
- {
- this.c_arrow = p;
- this.button_up.setSkins();
- this.button_down.setSkins();
- };
- ultimateScrollerClass.prototype.getForegroundDisabled = function()
- {
- return this.c_foregroundDisabled;
- };
- ultimateScrollerClass.prototype.setForegroundDisabled = function(p)
- {
- this.c_foregroundDisabled = p;
- this.button_up.setSkins();
- this.drag.setSkins();
- this.button_down.setSkins();
- this.track_mc.setSkins();
- };
- ultimateScrollerClass.prototype.getScrollTrack = function()
- {
- return this.c_scrollTrack;
- };
- ultimateScrollerClass.prototype.setScrollTrack = function(p)
- {
- this.c_scrollTrack = p;
- this.track_mc.setSkins();
- };
- ultimateScrollerClass.prototype.getBorderColorTop = function()
- {
- return this.c_borderColorT;
- };
- ultimateScrollerClass.prototype.setBorderColorTop = function(p)
- {
- this.c_borderColorT = p;
- if(eval(this.targetClip._name) && this.c_borderStyle eq "line")
- {
- this.drawBorder();
- }
- };
- ultimateScrollerClass.prototype.getBorderColorBottom = function()
- {
- return this.c_borderColorB;
- };
- ultimateScrollerClass.prototype.setBorderColorBottom = function(p)
- {
- this.c_borderColorB = p;
- if(eval(this.targetClip._name) && this.c_borderStyle eq "line")
- {
- this.drawBorder();
- }
- };
- ultimateScrollerClass.prototype.getBorderColorLeft = function()
- {
- return this.c_borderColorL;
- };
- ultimateScrollerClass.prototype.setBorderColorLeft = function(p)
- {
- this.c_borderColorL = p;
- if(eval(this.targetClip._name) && this.c_borderStyle eq "line")
- {
- this.drawBorder();
- }
- };
- ultimateScrollerClass.prototype.getBorderColorRight = function()
- {
- return this.c_borderColorR;
- };
- ultimateScrollerClass.prototype.setBorderColorRight = function(p)
- {
- this.c_borderColorR = p;
- if(eval(this.targetClip._name) && this.c_borderStyle eq "line")
- {
- this.drawBorder();
- }
- };
- ultimateScrollerClass.prototype.addProperty("horizontal",ultimateScrollerClass.prototype.getHorizontal,ultimateScrollerClass.prototype.setHorizontal);
- ultimateScrollerClass.prototype.addProperty("scrollTarget",ultimateScrollerClass.prototype.getTarget,ultimateScrollerClass.prototype.setTarget);
- ultimateScrollerClass.prototype.addProperty("size",ultimateScrollerClass.prototype.getSize,ultimateScrollerClass.prototype.setSize);
- ultimateScrollerClass.prototype.addProperty("scrollBuffer",ultimateScrollerClass.prototype.getBuffer,ultimateScrollerClass.prototype.setBuffer);
- ultimateScrollerClass.prototype.addProperty("scrollAmount",ultimateScrollerClass.prototype.getScrollAmount,ultimateScrollerClass.prototype.setScrollAmount);
- ultimateScrollerClass.prototype.addProperty("easing",ultimateScrollerClass.prototype.getEasing,ultimateScrollerClass.prototype.setEasing);
- ultimateScrollerClass.prototype.addProperty("useMask",ultimateScrollerClass.prototype.getUseMask,ultimateScrollerClass.prototype.setUseMask);
- ultimateScrollerClass.prototype.addProperty("dragVisible",ultimateScrollerClass.prototype.getDragVisible,ultimateScrollerClass.prototype.setDragVisible);
- ultimateScrollerClass.prototype.addProperty("dragHeightAuto",ultimateScrollerClass.prototype.getDragHeightAuto,ultimateScrollerClass.prototype.setDragHeightAuto);
- ultimateScrollerClass.prototype.addProperty("scrollSide",ultimateScrollerClass.prototype.getScrollSide,ultimateScrollerClass.prototype.setScrollSide);
- ultimateScrollerClass.prototype.addProperty("borderStyle",ultimateScrollerClass.prototype.getBorderStyle,ultimateScrollerClass.prototype.setBorderStyle);
- ultimateScrollerClass.prototype.addProperty("face",ultimateScrollerClass.prototype.getFace,ultimateScrollerClass.prototype.setFace);
- ultimateScrollerClass.prototype.addProperty("shadow",ultimateScrollerClass.prototype.getShadow,ultimateScrollerClass.prototype.setShadow);
- ultimateScrollerClass.prototype.addProperty("darkshadow",ultimateScrollerClass.prototype.getDarkshadow,ultimateScrollerClass.prototype.setDarkshadow);
- ultimateScrollerClass.prototype.addProperty("highlight",ultimateScrollerClass.prototype.getHighlight,ultimateScrollerClass.prototype.setHighlight);
- ultimateScrollerClass.prototype.addProperty("highlight3d",ultimateScrollerClass.prototype.getHighlight3d,ultimateScrollerClass.prototype.setHighlight3d);
- ultimateScrollerClass.prototype.addProperty("arrow",ultimateScrollerClass.prototype.getArrow,ultimateScrollerClass.prototype.setArrow);
- ultimateScrollerClass.prototype.addProperty("foregroundDisabled",ultimateScrollerClass.prototype.getForegroundDisabled,ultimateScrollerClass.prototype.setForegroundDisabled);
- ultimateScrollerClass.prototype.addProperty("scrollTrack",ultimateScrollerClass.prototype.getScrollTrack,ultimateScrollerClass.prototype.setScrollTrack);
- ultimateScrollerClass.prototype.addProperty("borderColorTop",ultimateScrollerClass.prototype.getBorderColorTop,ultimateScrollerClass.prototype.setBorderColorTop);
- ultimateScrollerClass.prototype.addProperty("borderColorBottom",ultimateScrollerClass.prototype.getBorderColorBottom,ultimateScrollerClass.prototype.setBorderColorBottom);
- ultimateScrollerClass.prototype.addProperty("borderColorLeft",ultimateScrollerClass.prototype.getBorderColorLeft,ultimateScrollerClass.prototype.setBorderColorLeft);
- ultimateScrollerClass.prototype.addProperty("borderColorRight",ultimateScrollerClass.prototype.getBorderColorRight,ultimateScrollerClass.prototype.setBorderColorRight);
- ultimateScrollerClass.prototype.addProperty("scrollTrackVisible",ultimateScrollerClass.prototype.getScrollTrackVisible,ultimateScrollerClass.prototype.setScrollTrackVisible);
- ultimateScrollerClass.prototype.addProperty("buttonsVisible",ultimateScrollerClass.prototype.getButtonsVisible,ultimateScrollerClass.prototype.setButtonsVisible);
- ultimateScrollerClass.prototype.addProperty("arrowsVisible",ultimateScrollerClass.prototype.getArrowsVisible,ultimateScrollerClass.prototype.setArrowsVisible);
- ultimateScrollerClass.prototype.addProperty("arrowDefaultColor",ultimateScrollerClass.prototype.getArrowDefaultColor,ultimateScrollerClass.prototype.setArrowDefaultColor);
- ultimateScrollerClass.prototype.addProperty("scrollWidth",ultimateScrollerClass.prototype.getScrollWidth,ultimateScrollerClass.prototype.setScrollWidth);
- ultimateScrollerClass.prototype.addProperty("useDisabledColor",ultimateScrollerClass.prototype.getUseDisabledColor,ultimateScrollerClass.prototype.setUseDisabledColor);
- Object.registerClass("ultimateScroller",ultimateScrollerClass);
-